/*
 * loadgraph.h
 *
 *  Created on: Jun 3, 2011
 *      Author: timothy
 */

#ifndef LOADGRAPH_H
#define LOADGRAPH_H

#include "init.h"
#include "shingletypes.h"

class InFile
{
	private:
		FILE *stream;
		char **tokBuffers;
	public:
		// FIELDS //
		int lineLength;
		int numVertices;
		int numEdges;


		// CONSTRUCTOR //
		// Opens a file stream, reads the first line for numVertices,
		//   and sets an appropriate lineLength.
		InFile();

		~InFile();

		// METHODS //
		// Reads a line from the input stream into the buffer.
		//   This method is OMP critical
		int ReadLine(char *buf);

		// Returns 0 if the input line cannot produce shingles.
		int Prune(char *line);

		// Returns 1 if the stream is at end of file, 0 otherwise.
		int EndOfFile();
};

#endif
